<template>
	<div>
		<add-address-info :getNowAddress="getNowAddress" :addFlag = "addFlag" :getUserInfo="getUserInfo"></add-address-info>
	</div>
</template>

<script>
import AddAddressInfo from "../../../real-components/AddAddress/AddAddressInfo";
import {mapGetters} from "vuex";
	export default {
	  	name: 'hello',
	  	data () {
	    	return {
				msg: '这是新增地址页面',
	            page: "AddAddressInfo",
	            componentName: "AddAddressInfo",
	            dataList: [],
	            addFlag:false
			}
		},
		computed: {
			...mapGetters([
				"getDomTree"
			]),
			...mapGetters('zx',[
				"getaddFlag","getUserInfo","getNowAddress"
			]),
		},
		components: {
	        "add-address-info": AddAddressInfo,
	    },
	    methods: {
	        getData() {
	        
				console.log(123456);
	        },
	        getEAFlag(){
	        	this.addFlag = this.$store.getters['zx/getaddFlag'];
	        	console.log(this.addFlag,666);
	        },
	    },
		created () {
			this.getData();
			this.getEAFlag();
		},
		mounted () {
			// initDomTree(this.getDomTree[this.page]);
			
		},
		updated() {
			//页面更新完毕
			// initDomTree(this.getDomTree[this.page]);
		},
		beforeCreate(){
	        let scriptFile = document.createElement('script')
	        scriptFile.setAttribute("type","text/javascript")
	        scriptFile.setAttribute("id","addAddress")
	        scriptFile.setAttribute("src",'static/script/picker.min.js')
	        document.getElementsByTagName("head")[0].appendChild(scriptFile)
	    },
	    beforeDestroy(){
	        let sciDom = document.getElementById('addAddress')
	        sciDom.parentNode.removeChild(sciDom)
	    },
	}
</script>

<style scoped="scoped">
</style>